<?php

/**
* @current cmscommentaudit.php
* @author   LiuYang <liu_yang@haibao.com>
* @date 2017年2月8日 下午4:19:41
*/
namespace haibao\jiepai\model\data\comment;

class CmsCommentAudit extends \haibao\jiepai\model\data\Base{
    
    /**
     * 0，误报1，涉嫌广告 2，言论不实 3，言论过激 4，纠纷举报 5，网监违禁 6，其他
     */
    const CATEGORY_ERROR = 0;
    const CATEGORY_AD = 1;
    const CATEGORY_FALSE = 2;
    const CATEGORY_RADICAL = 3;
    const CATEGORY_REPORT = 4;
    const CATEGORY_PROHIBITED = 5;
    const CATEGORY_OTHER = 6;
    
    /**
     * 1-已通过 2-未通过
     */
    const STATUS_OK = 1;
    const STATUS_NO = 2;
    
    /**
     * 1,评论 2，回复
     */
    const TYPE_COMMENT = 1;
    const TYPE_REPLY = 2;
    
    /**
     * 删除时置为-1，默认是0
     * 是否是删除
     */
    const FLAG_IS = 0;
    const FLAG_DEL = -1;
    
    public $Category;
    
    public $Reason;
    
    public $CreateTime;
    
    public $Status;
    
    public $UserID;
    
    public $Type;
    
    public $TypeID;
    
    public $Flag;
    
    public function __construct(){
        parent::__construct();

        $this->intField('Category', 'Category');
        $this->stringField('Reason', 'Reason');
        $this->dateField('CreateTime', 'CreateTime',true);
        $this->intField('Status', 'Status',true);
        $this->intField('UserID', 'UserID');
        $this->intField('Type', 'Type',true);
        $this->intField('TypeID', 'TypeID',true);
        $this->intField('Flag', 'Flag',true);

        $this->setTableName('cms_comment_audit');
    }

    public static function getCategoryMap($categoryId){

        $arr = array(
            self::CATEGORY_ERROR => '未选择',
            self::CATEGORY_AD => '涉嫌广告',
            self::CATEGORY_FALSE => '言论不实',
            self::CATEGORY_RADICAL => '言论过激',
            self::CATEGORY_REPORT => '纠纷举报',
            self::CATEGORY_PROHIBITED => '网监违禁',
            self::CATEGORY_OTHER => '其他',
        );

        return $arr[$categoryId];
    }
}


